import random

# 定义六壬课的基本元素
sky_gods = ["贵人", "螣蛇", "朱雀", "六合", "勾陈", "青龙", "天空", "白虎", "太常", "玄武", "太阴", "天后"]
earthly_branches = ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"]
# 简单的课体解释（仅为示例）
lesson_interpretations = {
    "贵登天门": "此课主有贵人相助，百事顺遂，利于出行、谋事。",
    "蛇化青龙": "先有惊恐之事，后转吉运，宜把握时机。",
    "龙战于野": "运势有争斗之象，行事需谨慎，不可冲动。"
}
# 简单模拟可能出现的课体
possible_lessons = list(lesson_interpretations.keys())


def shake_divination():
    """模拟摇卦过程"""
    # 随机选取天将和地支
    sky_god = random.choice(sky_gods)
    earthly_branch = random.choice(earthly_branches)
    # 随机选取一个课体
    lesson = random.choice(possible_lessons)
    print(f"摇得天将：{sky_god}，地支：{earthly_branch}，课体：{lesson}")
    print(lesson_interpretations[lesson])


def main():
    print("欢迎来到六壬摇卦游戏！")
    while True:
        print("\n请选择操作：")
        print("1. 摇卦")
        print("2. 退出游戏")
        choice = input("请输入选项编号：")
        if choice == "1":
            shake_divination()
        elif choice == "2":
            print("游戏结束，感谢参与！")
            break
        else:
            print("无效的选项，请重新输入。")


if __name__ == "__main__":
    main()